package com.zlcx.tz.live.domain;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.annotation.Transient;
import org.springframework.transaction.annotation.Transactional;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.io.Serializable;

/**
 * @author shixiaopeng
 *
 * 连麦免费相关信息设置
 */
@Data
@Entity(name = "tz_live_free")
@JsonSerialize
@DynamicUpdate
@DynamicInsert
public class LiveFree implements Serializable {

    private static final long serialVersionUID = -7710975848079627189L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    /**
     * 非会员是否可以创建房间，1可以，0不可以
     */
    @ApiModelProperty(value="非会员是否可以创建房间，1可以，0不可以")
    private Integer createRoomFlag;
    /**
     *每次免费时长，分钟
     */
    @ApiModelProperty(value="每次免费时长，分钟")
    private Integer freeTimes;

    @ApiModelProperty(value="每天总的免费次数")
    private Integer totalFreeNum;
    /**
     *每天免费剩余次数
     */
    @ApiModelProperty(value="每天免费剩余次数")
    @javax.persistence.Transient
    private Integer freeNum;

    public enum CreateRoomFlagEnum{
        ON(1, "yes"),
        OFF(0, "no");

        public final Integer code;
        public final String desc;
        CreateRoomFlagEnum(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }


    }
}